<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            width: 100px;
            height: 100px;
            background: #abcdef;
        }
    </style>
</head>
<div id="cont" draggable="true"></div>
<script>
    window.onload = function() {
        var cont = document.getElementById("cont");
        var img = document.createElement("img");
        img.src = "../small.jpg";
        cont.ondragstart = function(ev) {
            ev.dataTransfer.setDragImage(img, 50, 50)
        }
    }
</script>

<body>

</body>

</html>